-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOCS] Refactor, update, create documentation #1371
Conversation
68c4076
to
5b91ba4
Compare
d1097f2
to
6098887
Compare
- [![API Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/rails-api/active_model_serializers) | ||
- [Guides](https://github.com/rails-api/active_model_serializers/tree/master/docs) | ||
- [0.9 Documentation](https://github.com/rails-api/active_model_serializers/tree/0-9-stable) | ||
- [0.8 Documentation](https://github.com/rails-api/active_model_serializers/tree/0-8-stable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Older docs in 0-8 and 0-9 are pretty good. We should bring some of that back.
c7c9a03
to
edd6e21
Compare
ref: caching #1372 |
c3c72d5
to
1b2324b
Compare
@rails-api/ams thoughts? I think this is a big improvement to the docs in general, but am afraid I might have missed something |
1b2324b
to
ce17a1b
Compare
|
||
```ruby | ||
ActiveModel::Serializer.config.adapter = :json_api | ||
render @posts, include: 'author.comments.**' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not render json: @posts, include: 'author.comments.**'
?
23d558e
to
9c3431d
Compare
👏 |
|
||
It's the default adapter, it generates a json response without a root key. | ||
Doesn't follow any specific convention. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #1371 (comment)
It just said
#### Attributes
It's the default adapter, it generates a json response without a root key.
Doesn't follow any specific convention.
Thanks @duduribeiro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weir'd it's totally there in the rendered view.. https://github.com/bf4/active_model_serializers/blob/documentation_updates/docs/general/adapters.md#attributes---default must just be elided in the diff
|
||
## Rails Integration | ||
|
||
AMS will automatically integrate with you Rails app, you won't need to update your controller, this is a example of how it will look like: | ||
ActiveModelSerializers will automatically integrate with you Rails app, you won't need to update your controller, this is a example of how it will look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ActiveModelSerializers will automatically integrate with your Rails app, so you won't need to update your controller. This is an example of how it could look:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍻
I think I might be good with this. I only noticed the one grammar error. Nice work, @bf4 ! |
@duduribeiro @NullVoxPopuli any thoughts about file names or where things should go?
|
I think general should have information on things about AMS, rather than usage (what I think howto would be good for) |
More details please :). Ref by file name and topic/contents is good. B mobile phone
|
@NullVoxPopuli #1371 (comment) I'm going to merge this since it'll make everyone's work in ongoing pr's easier if it's already in master, and mine as well, if I have to diff various PRs with new documentation, and it seems like the parts we're uncertain about can be addressed as we use it. |
sounds good, @bf4 |
[DOCS] Refactor, update, create documentation
Let's hope this helps and doesn't cause too much difficulty on the part of PR creators... |
I did a lot of re-organizing, included deduplication of content.
I also wrote some new docs.
There are likely bugs:
Please help review!
view
on any of the files in the the diff to see how they renderNote to self, https://github.com/rails-api/active_model_serializers/blob/0-8-stable/DESIGN.textile is neat. It's not in the commit history since 0.10 starts from it's own root node.